/* ==========================================================================
 * MATLAB C++ matfile generator class v0.1
 * ==========================================================================
 * Copyright (C) 2013 - Ericson Norberto A Santos (ericsonnorberto@gmail.com)
 * Federal University Of Campina Grande - UFCG
 * 
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Based on "Portable ANSI C MATLAB file exporter" by Malcolm McLean
 * http://www.malcolmmclean.site11.com/www/MatlabFiles/matfiles.html
 * Copyright (c) Malcolm McLean
*/
#ifndef MAT_FILE_H
    #define MAT_FILE_H

#include "MAT_defines.hpp"

class MAT_file
{
    public:
        MAT_file();
        virtual ~MAT_file();
        
        int MATLAB_new_mat_file(const string& filename);
        
        int MATLAB_write_single_data_string(const string& s_tag, const string& d_value);
        int MATLAB_write_matrix_data(const string& s_tag, double *d_value, int n_row, int n_col, int d_transpose);
        
        
        
    private:
        
        bool   MATLAB_file_exists(const string& filename);
        string MATLAB_get_date_time_system();
        int    MATLAB_round8(int d_value);
        int    MATLAB_fput16le(int d_value);
        int    MATLAB_fput32le(int d_value);
        int    MATLAB_fwriteieee754(double d_value, int big_endian);
        
        
        ofstream mat_filename;
        

};
#endif
/* MAT_FILE_H */